package com.o2o.model.topic;

import java.util.Date;
import java.util.List;

import com.o2o.base.BaseModel;
import com.o2o.model.user.User;
import com.o2o.util.TimeUtil;

public class TopicContent extends BaseModel{

	/**
	 * 主题帖回复类
	 */
	private static final long serialVersionUID = -6296797515281581238L;
	
	private long id;
	
	private String content;//发表的评论内容
	
	private long topicId;//评论的主题帖id
	
	private User fromUser;//评论的用户
	
	private long fromUserId;//评论的用户id
	
	private User toUser;//被评论的用户
	
	private long toUserId;//被评论的用户id
	
	private long createTime;//发表时间
	
	private int greateTimes;
	
	private long fatherId;//回复评论的评论id，自关联，为0的话，是主题帖的回复
	
	private List<TopicContent> subContentList;//评论的回复
	
	
	
	public User getFromUser() {
		return fromUser;
	}

	public void setFromUser(User fromUser) {
		this.fromUser = fromUser;
	}

	public User getToUser() {
		return toUser;
	}

	public void setToUser(User toUser) {
		this.toUser = toUser;
	}

	public List<TopicContent> getSubContentList() {
		return subContentList;
	}

	public void setSubContentList(List<TopicContent> subContentList) {
		this.subContentList = subContentList;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public long getTopicId() {
		return topicId;
	}

	public void setTopicId(long topicId) {
		this.topicId = topicId;
	}


	

	public long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}

	public int getGreateTimes() {
		return greateTimes;
	}

	public void setGreateTimes(int greateTimes) {
		this.greateTimes = greateTimes;
	}

	public long getFatherId() {
		return fatherId;
	}

	public void setFatherId(long fatherId) {
		this.fatherId = fatherId;
	}

	
	
	/**
	 * 获取商品创建时间
	 * @return Date
	 */
	public Date getTopicContentCreateDate(){
		return TimeUtil.GetDateTimeByStamp(this.createTime);
	}
	
	public TopicContent() {
		super();
	}

	public long getFromUserId() {
		return fromUserId;
	}

	public void setFromUserId(long fromUserId) {
		this.fromUserId = fromUserId;
	}

	public long getToUserId() {
		return toUserId;
	}

	public void setToUserId(long toUserId) {
		this.toUserId = toUserId;
	}

	public TopicContent(long id, String content, long topicId, long fromUserId,
			long toUserId, long createTime, int greateTimes, long fatherId) {
		this.id = id;
		this.content = content;
		this.topicId = topicId;
		this.fromUserId = fromUserId;
		this.toUserId = toUserId;
		this.createTime = createTime;
		this.greateTimes = greateTimes;
		this.fatherId = fatherId;
	}

	@Override
	public String toString() {
		return "TopicContent [id=" + id + ", content=" + content + ", topicId="
				+ topicId + ", fromUser=" + fromUser + ", fromUserId="
				+ fromUserId + ", toUser=" + toUser + ", toUserId=" + toUserId
				+ ", createTime=" + createTime + ", greateTimes=" + greateTimes
				+ ", fatherId=" + fatherId + ", subContentList="
				+ subContentList + "]";
	}


	
	
	
	

}
